package info.jimao.newsdk.utilities;

import android.content.Context;

import info.jimao.newsdk.ApiManager;
import info.jimao.newsdk.ApiRoutes;
import info.jimao.newsdk.callbacks.IMTokenCallback;


public class RongYunApi {
    private Context context;
    private ApiManager apiManager;

    public RongYunApi(Context context) {
        this.context = context;
        this.apiManager = ApiManager.getInstance();
    }

    public void getIMAccessToken(String userId, String nickName, String logoUrl, IMTokenCallback callback) {
        apiManager.get(ApiRoutes.RONG_TOKEN)
                  .tag(context)
                  .addParams("userId", userId)
                  .addParams("name", nickName)
                  .addParams("portraitUri", logoUrl)
                  .build().execute(callback);
    }
}
